package com.java80.springmall.cloud.user.consumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.java80.springmall.cloud.user.consumer.entity.User;
import com.java80.springmall.cloud.user.consumer.service.UserService;

@RestController
@RequestMapping("/user")
public class UserConsumerController {

	@Autowired
	private UserService usvc;
	@GetMapping("/get/{id}")
	public User findById(@PathVariable Long id) {
		return this.usvc.findById(id);
	}
	@PostMapping("/login")
	public User login(String username) {
		return this.usvc.login(username);
	}
}
